<template>
    <div class="col p10 card">
      <label class="title">煮面室内门控制</label>
      <div class="row_center mt">
        <el-button @click="onClickOpen" type="primary">打开</el-button>
        <el-button @click="onClickClose" type="primary">关闭</el-button>
      </div>
    </div>
  </template>
  
  <script setup lang="ts">
  import { dialog } from '../../service/ui';
  import { pasta_door_ctrl } from '../../service/main_cmd';
  
  async function onClickOpen() {
  
    try {
      await pasta_door_ctrl(0);
      dialog.succ('煮面室内门打开成功');
    } catch (msg) {
      dialog.err(msg);
    }
  }
  
  async function onClickClose() {
    try {
      await pasta_door_ctrl(1);
      dialog.succ('煮面室内门关闭成功');
    } catch (msg) {
      dialog.err(msg);
    }
  }
  
  </script>
  